package day07_class.src.com.itheima.homework2;

public class Teacher {
    /*
     请定义教师类（Teacher），属性包括姓名和工号。
     要求分别使用空参和有参构造方法创建对象，空参创建的对象通过setXxx赋值，有参创建的对象直接赋值。
     定义教课（teach）方法，输出“工号为xxx的xxx老师正在讲课”
     */
    private String teacherName;
    private int idcard;

    public Teacher() {
    }

    public Teacher(String teacherName, int idcard) {
        this.teacherName = teacherName;
        this.idcard = idcard;
    }

    public String getTeacherName() {
        return teacherName;
    }

    public void setTeacherName(String teacherName) {
        this.teacherName = teacherName;
    }

    public int getIdcard() {
        return idcard;
    }

    public void setIdcard(int idcard) {
        this.idcard = idcard;
    }
    public void teach(){
        System.out.println("工号为"+idcard+"的"+teacherName+"老师正在讲课");
    }
}
